package com.welisit.test.service;

import com.welisit.test.model.AepTimerQuartzConfig;
import org.quartz.Scheduler;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.scheduling.quartz.CronTriggerBean;

import java.util.List;

/**
 * @author welisit
 * @create 2022-04-22 16:40
 */
public interface TimerManagerService {

    /**
     * 查询数据库任务设置,返回列表
     * @return 数据库任务设置列表
     */
    List<AepTimerQuartzConfig> getQuartzConfig();

    /**
     * 更新定时任务
     * @return
     * @throws Exception
     */
    void change(AepTimerQuartzConfig tbcq, CronTriggerBean trigger, Scheduler scheduler)throws Exception;

    /**
     * 创建/添加计划任务
     * 计划任务配置对象
     * @param tbcq
     * @param scheduler
     * @param beanFactory
     * @throws Exception
     */
    void createCronTriggerBean(AepTimerQuartzConfig tbcq, Scheduler scheduler, BeanFactory beanFactory) throws Exception;

}
